package com.lin.spi;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @ClassName SpiTest
 * @Description
 * @Author lin
 * @Date 2022/7/3 上午1:04
 * @Version V1.0
 */
public class SpiTest {
    public static void main(String[] args) {
        ServiceLoader<PublicService> load = ServiceLoader.load(PublicService.class);
        Iterator<PublicService> iterator = load.iterator();
        while (iterator.hasNext()) {
            iterator.next().process();
        }
    }
}
